home *** CD-ROM | disk | FTP | other *** search
- Path: cnn.exu.ericsson.se!news
- From: ebumow@ebu.ericsson.com (Mickey Williams 66753)
- Newsgroups: comp.lang.c++
- Subject: Re: class defined after use?
- Date: 12 Jan 1996 21:02:26 GMT
- Organization: Ericsson Inc.
- Distribution: world
- Message-ID: <4d6i92$sgk@cnn.exu.ericsson.se>
- References: <4d4l4a$ecg@news1.wolfe.net>
- Reply-To: ebumow@ebu.ericsson.com
- NNTP-Posting-Host: franklin.ebu.ericsson.se
-
- In article ecg@news1.wolfe.net, mgooding@wolfe.net (Joshua Gooding) writes:
- >Is it possible to have a class with a pointer to a variable of another
- >type that is defined later int he file?
-
- Sure, just make a forward declaration:
-
- class X;
- class Y{
- X* x;
- };
- class X{};
- int main()
- {
- Y y;
- return 0;
- }
-
-
-